package Loop;

import java.util.Scanner;

/**
 * Enjoy programming!!!
 * 时间： 2021/10/22 -  14:51
 */
public class For {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        System.out.print("How many numbers do you need to draw?");
        int k = in.nextInt();

        System.out.print("What is the highest number you can draw?");
        int n = in.nextInt();

        int lottery0dds = 1;
        for (int i = 1; i <= k; i++) {
            lottery0dds = lottery0dds * (n - i + 1) / i;
//            这里不用for（int i = 0;i < k;i++)的原因是分母不能为0，所以i要从1开始！！
        }

        System.out.println("Your odds are 1 in " + lottery0dds + ". Good luck!");


    }
}
